package cn.funeralobjects.dictms;

import cn.funeralobjects.common.jpa.CommonJpaRepository;
import cn.funeralobjects.common.jpa.support.CommonRepositoryFactoryBean;
import com.querydsl.jpa.JPQLQueryFactory;
import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import javax.persistence.EntityManager;

/**
 * @author FuneralObjects
 * Create date: 2020/6/3 2:57 AM
 */
@SpringBootApplication
@EnableJpaRepositories(repositoryFactoryBeanClass = CommonRepositoryFactoryBean.class, repositoryBaseClass = CommonJpaRepository.class, basePackages = {"cn.funeralobjects.**.repository"})
public class ServiceTestsApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceTestsApplication.class, args);
    }

    @Bean
    public JPQLQueryFactory jpqlQueryFactory(EntityManager entityManager) {
        return new JPAQueryFactory(entityManager);
    }
}
